import request from '@/utils/request'

// 查询工艺路线列表
export function listProcessRoute(query) {
  return request({
    url: 'tech/processRoute/list',
    method: 'get',
    params: query
  })
}

// 查询工艺路线详细
export function getProcessRoute(id) {
  return request({
    url: 'tech/processRoute/' + id,
    method: 'get'
  })
}

// 新增工艺路线
export function addProcessRoute(data) {
  return request({
    url: 'tech/processRoute',
    method: 'post',
    data: data
  })
}

// 修改工艺路线
export function updateProcessRoute(data) {
  return request({
    url: 'tech/processRoute',
    method: 'put',
    data: data
  })
}

// 删除工艺路线
export function delProcessRoute(id) {
  return request({
    url: 'tech/processRoute/' + id,
    method: 'delete'
  })
}

// 基于工艺路线，查询出已关联所选产品工艺的产线、工艺段作为选项
export function getMatCodeList(query) {
  return request({
    url: 'tech/processRoute/getMatCodeList',
    method: 'get',
    params: query
  })
}
